import axios from "./axios";

// 登录
export function login(user){
    return axios({
        url: '/login',
        method: 'post',
        params: user,
    })
}


// 请求社团类型
export function clubTypeList (){
    return axios({
        url: '/admin/clubTypeList',
        method: 'post',
    })
}
export function clubTypeListApi (){
    return axios({
        url: '/api/clubTypeList',
        method: 'post',
    })
}

// 添加社团
export function clubInsert(club){
    return axios({
        url: '/admin/clubInsert',
        method: 'post',
        params: club,
        })
}

// 社团列表
export function clubList(club){
    return axios({
        url: '/admin/clubList',
        method: 'post',
        params: club,
    })
}
export function clubListApi(club){
    return axios({
        url: '/api/clubList',
        method: 'post',
        params: club,
    })
}


// 通过id 查询社团信息
export function clubById(club){
    return axios({
        url: '/admin/clubById',
        method: 'post',
        params: club,
    })
}
export function clubByIdApi(club){
    return axios({
        url: '/api/clubById',
        method: 'post',
        params: club,
    })
}


// 通过name 查询社团信息
export function clubByName(club){
    return axios({
        url: '/admin/clubByName',
        method: 'post',
        params: club,
    })
}
export function clubByNameApi(club){
    return axios({
        url: '/api/clubByName',
        method: 'post',
        params: club,
    })
}


// 更新社团信息
export function clubUpdate(club){
    return axios({
        url: '/admin/clubUpdate',
        method: 'post',
        params: club,
    })
}

// 删除社团信息
export function clubDelete(club){
    return axios({
        url: '/admin/clubDelete',
        method: 'post',
        params: club,
    })
}

// 插入 社团类型
export function clubTypeInsert(clubType){
    return axios({
        url: '/admin/clubTypeInsert',
        method: 'post',
        params: clubType,
    })
}

// 通过id 查找社团类型
export function clubTypeById(clubType){
    return axios({
        url: '/admin/clubTypeById',
        method: 'post',
        params: clubType,
    })
}
// 更新 社团类型
export function clubTypeUpdate(clubType){
    return axios({
        url: '/admin/clubTypeUpdate',
        method: 'post',
        params: clubType
    })
}

// 删除 社团类型
export function clubTypeDelete(clubType){
    return axios({
        url: '/admin/clubTypeDelete',
        method: 'post',
        params: clubType
    })
}

// 通过 社团id 查询人员
export function clubPersonList(clubPerson){
    return axios({
        url: '/admin/clubPersonList',
        method: 'post',
        params: clubPerson
    })
}

// 添加社团人员
export  function  clubPersonInsert(clubPerson){
    return axios({
        url: '/admin/clubPersonInsert',
        method: 'post',
        params: clubPerson
    })
}

// 通过id 查询单个社员
export function clubPersonById(clubPerson){
    return axios({
        url: '/admin/clubPersonById',
        method: 'post',
        params: clubPerson
    })
}

// 更新 社员信息
export function clubPersonUpdate(clubPerson){
    return axios({
        url: '/admin/clubPersonUpdate',
        method: 'post',
        params: clubPerson
    })
}

// 删除社员
export function clubPersonDelete(clubPerson){
    return axios({
        url: '/admin/clubPersonDelete',
        method: 'post',
        params: clubPerson
    })
}

// 新闻类型 查询
export function articleTypeList(articleType){
    return axios({
        url: '/admin/articleTypeList',
        method: 'post',
        params: articleType
    })
}
export function articleTypeListApi(articleType){
    return axios({
        url: '/api/articleTypeList',
        method: 'post',
        params: articleType
    })
}

// 根据id 查询新闻类型
export function articleTypeById(articleType){
    return axios({
        url: '/admin/articleTypeById',
        method: 'post',
        params: articleType
    })
}

// 插入 新闻类型
export function articleTypeInsert(articleType){
    return axios({
        url: '/admin/articleTypeInsert',
        method: 'post',
        params: articleType
    })
}

// 更新 新闻类型
export function articleTypeUpdate(articleType){
    return axios({
        url: '/admin/articleTypeUpdate',
        method: 'post',
        params: articleType
    })
}

// 删除 新闻类型
export function articleTypeDelete(articleType){
    return axios({
        url: '/admin/articleTypeDelete',
        method: 'post',
        params: articleType
    })
}

// 查询 新闻
export function articleList(article){
    return axios({
        url: '/admin/articleList',
        method: 'post',
        params: article
    })
}
// 查询 新闻
export function articleListApi(article){
    return axios({
        url: '/api/articleList',
        method: 'post',
        params: article
    })
}


// 插入 新闻
export function articleInsert(article){
    return axios({
        url: '/admin/articleInsert',
        method: 'post',
        params: article
    })
}

// 更新 新闻
export function articleUpdate(article){
    return axios({
        url: '/admin/articleUpdate',
        method: 'post',
        params: article
    })
}

// 删除 新闻
export function articleDelete(article){
    return axios({
        url: '/admin/articleDelete',
        method: 'post',
        params: article
    })
}

// 根据id 查询新闻
export function articleById(article){
    return axios({
        url: '/admin/articleById',
        method: 'post',
        params: article
    })
}
export function articleByIdApi(article){
    return axios({
        url: '/api/articleById',
        method: 'post',
        params: article
    })
}

// 活动类型 查询
export function activityTypeList(activityType){
    return axios({
        url: '/admin/activityTypeList',
        method: 'post',
        params: activityType
    })
}

// 活动类型 查询
export function activityTypeListApi(activityType){
    return axios({
        url: '/api/activityTypeList',
        method: 'post',
        params: activityType
    })
}

// 根据id 查询活动类型
export function activityTypeById(activityType){
    return axios({
        url: '/admin/activityTypeById',
        method: 'post',
        params: activityType
    })
}

// 插入 活动类型
export function activityTypeInsert(activityType){
    return axios({
        url: '/admin/activityTypeInsert',
        method: 'post',
        params: activityType
    })
}

// 更新 活动类型
export function activityTypeUpdate(activityType){
    return axios({
        url: '/admin/activityTypeUpdate',
        method: 'post',
        params: activityType
    })
}

// 删除 活动类型
export function activityTypeDelete(activityType){
    return axios({
        url: '/admin/activityTypeDelete',
        method: 'post',
        params: activityType
    })
}

// 活动 查询
export function activityList(activity){
    return axios({
        url: '/admin/activityList',
        method: 'post',
        params: activity
    })
}

export function activityListApi(activity){
    return axios({
        url: '/api/activityList',
        method: 'post',
        params: activity
    })
}

// 根据id 查询活动
export function activityById(activity){
    return axios({
        url: '/admin/activityById',
        method: 'post',
        params: activity
    })
}

// 根据id 查询活动
export function activityByIdApi(activity){
    return axios({
        url: '/api/activityById',
        method: 'post',
        params: activity
    })
}

// 插入 活动
export function activityInsert(activity){
    return axios({
        url: '/admin/activityInsert',
        method: 'post',
        params: activity
    })
}

// 更新 活动
export function activityUpdate(activity){
    return axios({
        url: '/admin/activityUpdate',
        method: 'post',
        params: activity
    })
}

// 删除 活动
export function activityDelete(activity){
    return axios({
        url: '/admin/activityDelete',
        method: 'post',
        params: activity
    })
}


// 插入 申请信息
export function applicantInsert(applicant){
    return axios({
        url: '/admin/applicantInsert',
        method: 'post',
        params: applicant
    })
}
export function applicantInsertApi(applicant){
    return axios({
        url: '/api/applicantInsert',
        method: 'post',
        params: applicant
    })
}


// 删除 申请信息
export function applicantDelete(applicant){
    return axios({
        url: '/admin/applicantDelete',
        method: 'post',
        params: applicant
    })
}

// 查询 申请信息
export function applicantList(applicant){
    return axios({
        url: '/admin/applicantList',
        method: 'post',
        params: applicant
    })
}

// 通过申请
export function applicantPass(applicant){
    return axios({
        url: '/admin/applicantPass',
        method: 'post',
        params: applicant
    })
}

// 图片上传
export function upLoadFile(formData){
    return axios({
        url: '/admin/upLoadFile',
        method: 'post',
        data: formData,
    })
}

// 图片列表
export function imageList(image){
    return axios({
        url: '/admin/ImageList',
        method: 'post',
        params: image,
    })
}
// 图片列表
export function imageListApi(image){
    return axios({
        url: '/api/ImageList',
        method: 'post',
        params: image,
    })
}

// 修改图片状态
export function imageUpdate(image){
    return axios({
        url: '/admin/ImageUpdate',
        method: 'post',
        params: image,
    })
}

// 插入图片
export function imageInsert(image){
    return axios({
        url: '/admin/ImageInsert',
        method: 'post',
        params: image,
    })
}

// 删除图片
export function imageDelete(image){
    return axios({
        url: '/admin/ImageDelete',
        method: 'post',
        params: image,
    })
}



// 退出登录
export function logout(){
    return axios({
        url: '/logout',
        method: 'post'
    })
}

// es 全局搜索

export function esObjectSearch(text,pageNum,pageSize){
    return axios({
        url: '/esObjectSearch',
        method: 'post',
        params: {text:text,pageNum:pageNum,pageSize:pageSize}
    })
}




// 文件上传，下载
export function readExcel(formData){
    return axios({
        url:'/admin/readExcel',
        method: 'post',
        data: formData
    })
}
